package com.roncoo.education.course.service.api.biz;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.roncoo.education.course.common.dto.CourseAppointmentDTO;
import com.roncoo.education.course.common.req.CourseAppointmentREQ;
import com.roncoo.education.course.service.dao.service.impl.mapper.CourseAppointmentIntroduceVOMapper;
import com.roncoo.education.util.base.Result;
import org.apache.ibatis.annotations.Param;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ApiCourseAppointmentBiz {
    @Autowired
    private CourseAppointmentIntroduceVOMapper mapper;

    /**
     * 用户查看自己预约课程
     * @param req
     * @return
     */
    public Result<Page<CourseAppointmentDTO>> getCourseAppointmentIntroduce(@Param("req") CourseAppointmentREQ req){
        Page<CourseAppointmentDTO>page=new Page<>(req.getPageCurrent(),req.getPageSize());
        List<CourseAppointmentDTO>list=mapper.getPageList(req.getUserNo(),page);
        return Result.success(page.setRecords(list));
    }

}
